//
//  QLNiceHomeViewController.m
//  Nice
//
//  Created by huangyueqi on 2017/7/24.
//  Copyright © 2017年 sjyt. All rights reserved.
//

#import "QLNiceHomeViewController.h"
#import "QLNiceLoginViewController.h"
#import "QLNiceNetworkTools.h"

@interface QLNiceHomeViewController ()

@property (weak, nonatomic) IBOutlet UILabel *titleLabel;

@end

@implementation QLNiceHomeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupUI];
}

#pragma mark - SetupUI
- (void)setupUI {

    NSString *title = @"来撕 我们都是一群喜欢撕逼的人欢迎你的加入";
    
    NSMutableAttributedString *titleMStr = [[NSMutableAttributedString alloc] initWithString:title];
    
    [titleMStr addAttribute:NSFontAttributeName
                      value:[UIFont systemFontOfSize:28]
                      range:NSMakeRange(0, title.length)];
    [titleMStr addAttribute:NSFontAttributeName
                      value:[UIFont systemFontOfSize:20]
                      range:NSMakeRange(2, title.length - 2)];
    self.titleLabel.attributedText = titleMStr;
}

//登录
- (IBAction)loginButton:(id)sender {
    
    QLNiceLoginViewController *vc = [[UIStoryboard storyboardWithName:@"QLNice" bundle:nil] instantiateViewControllerWithIdentifier:@"QLNiceLoginViewController"];
    [self presentViewController:vc animated:YES completion:nil];
}

//注册
- (IBAction)registerButton:(id)sender {
    
    NSString *url = @"http://news.coolban.com/Api/Index/news_list/app/2/cat/0/limit/20/time/1472031475/type/0?channel=appstore&uuid=1CF3D8F1-1DFA-4F0B-8335-40F209B0E355&net=5&model=iPhone&ver=1.0.5";
    [[QLNiceNetworkTools sharedTools] requestWithUrl:url andParams:nil andCallBack:^(id response, NSError *error) {
        
        NSLog(@"error - %@", error);
    }];
}


@end
